package champPackage;

import champPackage.Match;
import champPackage.Player;

public class Goal {
	private Match match;
	private Player player;
	private boolean isOwnGoal;
	private int minute,goalId;
	
	/**
	 * constructor is passed match, player, scoring minute and a boolean whether the goal is own goal 
	 * @param m
	 * @param p
	 * @param minute
	 * @param ownGoal
	 */
	public Goal(Match m, Player p, int minut, boolean ownGoal, int id){
		isOwnGoal=ownGoal;
		match=m;
		player=p;
		minute=minut;
		goalId=id;
	}
	
	/**
	 * if of the goal from Database
	 * @return
	 */
	public int getGoalId(){
		return goalId;
	}
	/**
	 * returns match object where the goal was scored
	 * @return
	 */
	public Match getMatch(){
		return match;
	}
	
	/**
	 * return a scorer player object
	 * @return
	 */
	public Player getScoringPlayer(){
		return player;
	}
	/**
	 * on which minute was the goal scored
	 * @return
	 */
	public int getMinute(){
		return minute;
	}
	
	/**
	 * shows if the goals is a own goal
	 * @return
	 */
	public boolean isOwnGoal(){
		return isOwnGoal;
	}
	

}
